package com.my.code;

/**
 * 测试字符串intern
 */
public class TestIntern {
    public static void main(String[] args) {
        String str1 = new StringBuilder("计算机").append("软件").toString();
        System.out.println(str1.intern() == str1);

        String str2 = "ja" + "va11";
        System.out.println(str2.intern() == str2);
    }
}
